package com.bh.shipment.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.bh.common.annotation.Dict;
import com.bh.common.annotation.Excel;
import com.bh.common.core.domain.BhtmsBaseEntity;
import com.bh.extend.domain.JcAbnormal;
import com.bh.kysys.domain.JcSysOrganization;
import com.bh.ledger.domain.JcCostApportionment;
import com.bh.ledger.domain.JcLedgerDetail;
import com.bh.ledger.domain.JcSettlement;
import com.bh.ledger.domain.JcVerificationZb;
import com.bh.order.domain.JcLed;
import com.bh.shipment.domain.JcBerthStand;
import com.bh.shipment.domain.JcShipmentBack;
import com.bh.shipment.domain.JcShipmentImg;
import com.bh.shipment.domain.JcVehicleArrive;
import com.bh.vehicle.domain.JcCarrier;
import com.bh.vehicle.domain.JcDriver;
import com.bh.vehicle.domain.JcVehicle;
import com.bh.vehicle.domain.JcVehicleHead;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 运单管理对象 jc_shipment
 *
 * @author slx
 * @date 2023-04-22
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class JcShipmentCustVo extends BhtmsBaseEntity {
    

    /**
     * 回单份数
     */
    @Excel(name = "回单份数")
    private Long backNumber;

    /**
     * 承运商合同是否超期
     */
    @Excel(name = "承运商合同是否超期")
    private Long carriageIsExceed;

    /**
     * 承运商类型
     */
    @Excel(name = "承运商类型")
    private Long carrierType;

    /**
     * 实际到达时间
     */
    @JsonFormat(timezone="GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "实际到达时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date factArriveTime;

    /**
     * 实际发运时间
     */
    @JsonFormat(timezone="GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "实际发运时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date factLeaverTime;

    /**
     * 付款方式
     */
    @Excel(name = "付款方式")
    private Integer feeType;

    /**
     * 是否有异常
     */
    @Excel(name = "是否有异常")
    private Integer isAbnormal;

    /**
     * 外部车牌号
     */
    @Excel(name = "外部车牌号")
    private String license;

    /**
     * 件数
     */
    @Excel(name = "件数")
    public Integer number;

    /**
     * 运作模式
     */
    @Excel(name = "运作模式")
    private Integer operationPattern;  //运作模式  -- 自营车辆    ----干线外包   ----外包中转   ---

    /**
     * 订单号
     */
    @Excel(name = "订单号")
    private String orderCode;

    /**
     * 外部司机名称
     */
    @Excel(name = "外部司机名称")
    private String outDriver;

    /**
     * 要求发运日期
     */
    @JsonFormat(timezone="GMT+8", pattern = "yyyy-MM-dd")
    @Excel(name = "要求发运日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date planLeaveTime;

    /**
     * 拒收标记
     */
    @Excel(name = "拒收标记")
    private Long refuse;

    /**
     * 发运单号
     */
    @Excel(name = "发运单号")
    private String relateBill1;

    /**
     * 要求到车日期
     */
    @JsonFormat(timezone="GMT+8", pattern = "yyyy-MM-dd")
    @Excel(name = "要求到车日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date requireArriveTime;

    /**
     * 运输方式
     */
    @Excel(name = "运输方式")
    private Integer shipmentMethod;

    /**
     * 发运单号
     */
    @Excel(name = "发运单号")
    private String tan;

    /**
     * 运单日期
     */
    @JsonFormat(timezone="GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "运单日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date time;

    /**
     * 货值
     */
    @Excel(name = "货值")
    private BigDecimal value;

    /**
     * 体积
     */
    @Excel(name = "体积")
    private BigDecimal volume;

    /**
     * 重量
     */
    @Excel(name = "重量")
    private BigDecimal weight;

    /**
     * 承运商ID
     */
    @Dict(dictTable = "jc_carrier", dictLabel = "name", dictValue = "id")
    @Excel(name = "承运商ID")
    private Long jcCarrierId;

    /**
     * 司机ID
     */
    @Excel(name = "司机ID")
    private Long jcDriverId;

    /**
     * 组织机构ID
     */
    @Excel(name = "组织机构ID")
    private Long jcOrganizationId;

    /**
     * 结算ID
     */
    @Excel(name = "结算ID")
    private Long jcSettlementId;

    /**
     * 车型ID
     */
    @Excel(name = "车型ID")
    private Long jcVehicleId;

    /**
     * 车头ID
     */
    @Excel(name = "车头ID")
    private Long jcVehicleHeadId;

    /**
     * 实际操作时间
     */
    @JsonFormat(timezone="GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "实际操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date actionTime;

    /**
     * 起运站ID
     */
    @Excel(name = "起运站ID")
    private Long jcFromOrganizationId;

    /**
     * 当前站ID
     */
    @Excel(name = "当前站ID")
    private Long jcNowOrganizationId;

    /**
     * 下一站ID
     */
    @Excel(name = "下一站ID")
    private Long jcNextOrganizationId;

    /**
     * 目的站ID
     */
    @Excel(name = "目的站ID")
    private Long jcToOrganizationId;

    /**
     * 经由站组织机构IDS
     */
    @Excel(name = "经由站组织机构IDS")
    private String orgIds;

    /**
     * 外部司机电话
     */
    @Excel(name = "外部司机电话")
    private String outPhone;

    /**
     * 途径站显示
     */
    @Excel(name = "途径站显示")
    private String orgnameList;

    /**
     * 计重
     */
    @Excel(name = "计重")
    private Long jzWeight;

    /**
     * 是否收入成本确认
     */
    @Excel(name = "是否收入成本确认")
    private Integer isConfirm;

    @TableField(exist = false)
    private JcCarrier carrier; //承运商
    @TableField(exist = false)
    private JcVehicle vehicle;//车型  指定车型
    @TableField(exist = false)
    private JcVehicleHead vehicleHead; //车头
    @TableField(exist = false)
    private JcDriver driver;//司机
    @TableField(exist = false)
    private JcShipmentBack shipmentBack;//运单回单
    @TableField(exist = false)
    private List<JcLed> leds;//分段订单
    @TableField(exist = false)
    private JcSysOrganization fromOrganization;//起运站
    @TableField(exist = false)
    private JcSysOrganization nowOrganization;//当前站
    @TableField(exist = false)
    private JcSysOrganization nextOrganization;//下一站
    @TableField(exist = false)
    private JcSysOrganization toOrganization;//目的站
    @TableField(exist = false)
    private List<JcBerthStand> berthStand;//停靠站
    @TableField(exist = false)
    private List<JcVehicleArrive> vehicleArrives;//到货车辆
    @TableField(exist = false)
    private JcSettlement settlement;//结算
    @TableField(exist = false)
    private List<JcCostApportionment> apportionments;//成本分摊
    @TableField(exist = false)
    private List<JcLedgerDetail> ledgerDetails;//台账明细
    @TableField(exist = false)
    private List<JcAbnormal> abnormals;
    @TableField(exist = false)
    private List<JcVerificationZb> verifications;//核销表
    @TableField(exist = false)
    private List<JcLed> ledsss;//分段订单
    @TableField(exist = false)
    private List<JcShipmentImg> imgs;//装车照片

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("code", getCode())
                .append("createName", getCreateName())
                .append("createTime", getCreateTime())
                .append("description", getDescription())
               
                .append("modifyName", getModifyName())
                .append("modifyTime", getModifyTime())
                .append("name", getName())
                .append("status", getStatus())
                .append("backNumber", getBackNumber())
                .append("carriageIsExceed", getCarriageIsExceed())
                .append("carrierType", getCarrierType())
                .append("factArriveTime", getFactArriveTime())
                .append("factLeaverTime", getFactLeaverTime())
                .append("feeType", getFeeType())
                .append("isAbnormal", getIsAbnormal())
                .append("license", getLicense())
                .append("number", getNumber())
                .append("operationPattern", getOperationPattern())
                .append("orderCode", getOrderCode())
                .append("outDriver", getOutDriver())
                .append("planLeaveTime", getPlanLeaveTime())
                .append("refuse", getRefuse())
                .append("relateBill1", getRelateBill1())
                .append("requireArriveTime", getRequireArriveTime())
                .append("shipmentMethod", getShipmentMethod())
                .append("tan", getTan())
                .append("time", getTime())
                .append("value", getValue())
                .append("volume", getVolume())
                .append("weight", getWeight())
                .append("jcCarrierId", getJcCarrierId())
                .append("jcDriverId", getJcDriverId())
                .append("jcOrganizationId", getJcOrganizationId())
                .append("jcSettlementId", getJcSettlementId())
                .append("jcVehicleId", getJcVehicleId())
                .append("jcVehicleHeadId", getJcVehicleHeadId())
                .append("actionTime", getActionTime())
                .append("jcFromOrganizationId", getJcFromOrganizationId())
                .append("jcNowOrganizationId", getJcNowOrganizationId())
                .append("jcNextOrganizationId", getJcNextOrganizationId())
                .append("jcToOrganizationId", getJcToOrganizationId())
                .append("orgIds", getOrgIds())
                .append("outPhone", getOutPhone())
                .append("orgnameList", getOrgnameList())
                .append("jzWeight", getJzWeight())
                .append("isConfirm", getIsConfirm())
                .toString();
    }
}
